reworked documentation of JSONLDSerializer.#3323
reworked documentation of JSONLDSerializer.#3323WhiteGobo wants to merge 2 commits intoRDFLib:7.xfrom
Conversation
… shown as parameter in serialize. Added docstrings. No functional change.
| ) | ||
|
|
||
| context_data = kwargs.get("context") | ||
| use_native_types = (kwargs.get("use_native_types", False),) |
There was a problem hiding this comment.
I just want to point out that use_native_types was previously a tuple(False,) whereas the new code changes it to a bool.
This alters the runtime behaviour, so it may not be strictly backwards compatible. I'm not sure whether the original tuple was intentional or an oversight.
@WhiteGobo what are your thoughts on this?
There was a problem hiding this comment.
oh sorry, i dont know how i missed your answer.
I'm sure the change in use_native_types from (bool,) to bool is an oversight by me. I didn't want to change any possible behaviour or data in documentation changes, unless i explicitly stated it somewhere.
There was a problem hiding this comment.
use_native_types is expected as bool in from_rdf. It seems like a bug, that it defaulted to (bool,) instead.
The only time it seems to be used is in line 418 on main, and there it result in a wrong result:
native = self.use_native_types and o.datatype in PLAIN_LITERAL_TYPES
# native can be True, when use_native_types == (False,)The behaviour wil change if we set the default value to False. Im certain with default value on True it will behave the same, but i think the behaviour wasnt intended.
I would suggest keeping the change to bool and False, but moving the merge to 8.0 instead.
Also i wonder if a test should check for this, as no test fails on changing use_native_types
Still work in correspondence to #3307.
Added missing documentation arguments.
Working towards that all arguments are accesible with
inspect.Summary of changes
Added more documentation to module and
JsonLDSerializer.serialize.Set default of
use_native_typestoFalse.Moved Arguments to serialize arguments, instead of extracting them from
**args.No functional change, but because i dont extract anything from
**argsanymore, there are some changes in the program code.Still missing explanation to argument
context.Added docstring to
PLAIN_LITERAL_TYPES.Added crosslink to
graph.serializeChecklist
the same change.
./examples.so maintainers can fix minor issues and keep your PR up to date.